<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of XPanel
 *
 * @author ardha
 * @created on Oct 23, 2012
 */
class XPanel extends CWidget {

    //put your code here
    public $showHeader = true;
    public $title = '';
    public $width = 930;
    public $height = 350;
    public $cssClass = 'x-panel x-panel-default-framed';
    //public $style = '';

    public function init() {
        //echo CHtml::openTag('div', array('class' => $this->cssClass, 'style' => 'width:'.$this->width.'px;height:'.$this->height.'px;'));
        echo '<div class="ax-panel">';
        if ($this->showHeader)
            $this->renderHeader2();
        $wd = $this->width-10;
        $hg = $this->height-49;
        echo '<div class="ax-body-panel">';
        //echo '<div style="padding: 5px 5px 0px; width: '.$wd.'px; left: 0px; top: 26px; height: '.$hg.'px; overflow:auto;" class="x-panel-body x-panel-body-default-framed x-docked-noborder-top x-docked-noborder-right x-docked-noborder-bottom x-docked-noborder-left">';
    }

    public function renderHeader() {
        echo '<div class="x-panel-header x-docked x-panel-header-default-framed x-horizontal x-panel-header-horizontal x-panel-header-default-framed-horizontal x-top x-panel-header-top x-panel-header-default-framed-top x-docked-top x-panel-header-docked-top x-panel-header-default-framed-docked-top x-unselectable" style="-moz-user-select: -moz-none; width: '.$this->width.'px; left: -1px; top: -1px;">';
        echo '<div class="x-panel-header-body x-panel-header-body-default-framed x-panel-header-body-horizontal x-panel-header-body-default-framed-horizontal x-panel-header-body-top x-panel-header-body-default-framed-top x-panel-header-body-docked-top x-panel-header-body-default-framed-docked-top x-panel-header-body-default-framed-horizontal x-panel-header-body-default-framed-top x-panel-header-body-default-framed-docked-top x-box-layout-ct" style="width: '.($this->width-12).'px;">';
        echo '<div role="presentation" class="x-box-inner " style="width: '.($this->width-12).'px; height: 17px;">';
        echo '<div style="position:absolute;width:20000px;left:0px;top:0px;height:1px">';
        echo '<div style="text-align: left; left: 0px; top: 0px; margin: 0px; width: '.($this->width-29).'px;" class="x-component x-panel-header-text-container x-box-item x-component-default">';
        echo '<span class="x-panel-header-text x-panel-header-text-default-framed">' . $this->title . '</span>';
        echo '</div>';
        echo '<div style="width: 15px; height: 15px; left: '.($this->width-27).'px; top: 1px; margin: 0px;" class="x-tool x-box-item x-tool-default">';
        echo '<img role="presentation" class="x-tool-collapse-top" src="">';
        echo '</div>';
        echo '</div>';
        echo '</div>';
        echo '</div>';
        echo '</div>';
    }
    public function renderHeader2() {
        echo '<div class="x-panel-header-default x-horizontal x-panel-header-horizontal x-panel-header-default-horizontal x-top x-panel-header-top x-panel-header-default-top x-docked-top x-panel-header-docked-top x-panel-header-default-docked-top x-unselectable" style="height:17px;border:0px;">';
        echo '                    <span class="x-panel-header-text x-panel-header-text-default">';
        echo '                        '.$this->title;
        echo '                    </span>';
        echo '</div>';
    }


    public function run() {
        echo CHtml::closeTag('div');
        echo CHtml::closeTag('div');
    }

}
?>